﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Brc_PaaS.Common.Model.RabbitMq
{
    public class RabbitMQSettingEntity
    {
        #region 配置文件中定义好的项
        /// <summary>
        /// 服务器地址
        /// </summary>
        public string ServerAddress { get; set; }
        /// <summary>
        /// 服务器端口
        /// </summary>
        public int ServerPort { get; set; }

        /// <summary>
        /// 最大连接数
        /// </summary>
        public int MaxSize { get; set; }
        /// <summary>
        /// 最小连接数
        /// </summary>
        public int MinSize { get; set; }
        #endregion

        #region 业务系统申请消息队列资源时PaaS为其创建的信息
        /// <summary>
        /// 名称
        /// </summary>
        public string UserName { get; set; }
        /// <summary>
        /// 访问密码
        /// </summary>
        public string Password { get; set; }
        /// <summary>
        /// vhost地址;
        /// </summary>
        public string VirtualHost { get; set; }
        /// <summary>
        /// 交换机名称
        /// </summary>
        public string ExchangeName { get; set; }
        /// <summary>
        /// 交换机类型
        /// </summary>
        public ExChangeType ExchangeType { get; set; }
        #endregion

        #region 向队列发送消息时所需信息，每次由调用方传入
        /// <summary>
        /// 路由键
        /// </summary>
        public string RouteKey { get; set; }        
        #endregion
    }
    public class EventMessage
    {
        /// <summary>
        /// 消息标记符号，以业务系统Id作为值
        /// </summary>
        public string MessageMark { get; set; }
        /// <summary>
        /// 消息创建时间
        /// </summary>
        public DateTime MessageCreatedTime { get; set; }
        /// <summary>
        /// 消息Id
        /// </summary>
        public string MessageId { get; set; }
        /// <summary>
        /// 消息体
        /// </summary>
        public string Message { get; set; }
    }

    public enum ExChangeType
    {
        Fanout = 0,
        Topic = 1,
        Direct = 2
    }
}
